var t = require;
var e = module;
var o = exports;
var i, n = this && this.__extends || (i = function(t, e) {
    return (i = Object.setPrototypeOf || {
        __proto__: []
    }
    instanceof Array &&
    function(t, e) {
        t.__proto__ = e
    } ||
    function(t, e) {
        for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o])
    })(t, e)
},
function(t, e) {
    function o() {
        this.constructor = t
    }
    i(t, e),
    t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o)
}),
a = this && this.__decorate ||
function(t, e, o, i) {
    var n, a = arguments.length,
    r = a < 3 ? e: null === i ? i = Object.getOwnPropertyDescriptor(e, o) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, o, i);
    else for (var s = t.length - 1; s >= 0; s--)(n = t[s]) && (r = (a < 3 ? n(r) : a > 3 ? n(e, o, r) : n(e, o)) || r);
    return a > 3 && r && Object.defineProperty(e, o, r),
    r
};
Object.defineProperty(o, "__esModule", {
    value: !0
});
var r = cc._decorator,
s = r.ccclass,
l = r.property,
c = function(t) {
    function e() {
        var e = null !== t && t.apply(this, arguments) || this;
        return e.lab_num = null,
        e.icon_hp = null,
        e.icon_damage = null,
        e.icon_elec = null,
        e.posInit = null,
        e
    }
    return n(e, t),
    e.prototype.onLoad = function() {
        this.node.active = !1,
        this.posInit = this.node.position
    },
    e.prototype.initView = function() {
        this.node.active = !1,
        this.icon_damage.active = !1,
        this.icon_hp.active = !1,
        this.icon_elec.active = !1,
        this.lab_num.node.active = !1
    },
    e.prototype.updateHint = function(t, e, o) {
        t < 0 ? this.elecHint() : e ? this.setLabelNum(this.icon_hp, this.lab_num, e) : o && this.setLabelNum(this.icon_damage, this.lab_num, o)
    },
    e.prototype.elecHint = function() {
        this.initView(),
        this.node.active = !0,
        this.icon_elec.active = !0,
        this.playAniOut()
    },
    e.prototype.setLabelNum = function(t, e, o) {
        if (o > 0) this.initView(),
        this.node.active = !0,
        t.active = !0,
        e.node.active = !0,
        e.node.color = new cc.Color(170, 251, 0),
        e.string = ":" + o;
        else {
            if (! (o < 0)) return t.active = !1,
            void(e.node.active = !1);
            this.initView(),
            this.node.active = !0,
            t.active = !0,
            e.node.active = !0,
            e.node.color = new cc.Color(255, 53, 0),
            e.string = ";" + Math.abs(o)
        }
        this.playAniOut()
    },
    e.prototype.playAniOut = function() {
        var t = this;
        this.node.scale = .2,
        this.node.stopAllActions();
        var e = this.posInit;
        cc.tween(this.node).to(.3, {
            scale: 1.2,
            position: cc.v3(e.x, e.y + 100, 0)
        }).delay(.5).to(.3, {
            scale: .2,
            position: cc.v3(e.x, e.y + 150, 0)
        }).call(function() {
            t.node.active = !1,
            t.node.position = e
        }).start()
    },
    a([l(cc.Label)], e.prototype, "lab_num", void 0),
    a([l(cc.Node)], e.prototype, "icon_hp", void 0),
    a([l(cc.Node)], e.prototype, "icon_damage", void 0),
    a([l(cc.Node)], e.prototype, "icon_elec", void 0),
    a([s], e)
} (cc.Component);
o.default = c